package com.itlaobing.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import cn.itlaobing.model.UserOrdersModel;

public class UserOrdersDao extends BaseDao<UserOrdersModel>{
	public List<UserOrdersModel> queryAllById(Integer id)throws ClassNotFoundException,SQLException
	{
		String sql="select * from userorders where userId=?";
		List<UserOrdersModel> list=new ArrayList<UserOrdersModel>();
		ResultSet rs=db.queryExcute(sql, id);
		while(rs.next())
		{
			UserOrdersModel uom=new UserOrdersModel();
			uom.setAggregateAmount(rs.getDouble("aggregateAmount"));
			uom.setGoodId(rs.getInt("goodId"));
			uom.setGoodNumber(rs.getString("goodNumber"));
			uom.setGoodOrder(rs.getString("goodOrder"));
			uom.setGoodStatus(rs.getString("goodStatus"));
			uom.setReceiverAddress(rs.getString("receiverAddress"));
			uom.setReceiverName(rs.getString("receiverName"));
			uom.setReceiverPhone(rs.getString("receiverPhone"));
			uom.setShoopingTime(rs.getDate("shoopingTime"));
			uom.setUserId(rs.getInt("userId"));
			list.add(uom);
		}
		return list;
		
	}
}
